<template>
    <div :class='["vux-header-box"]' slot="header" v-if="settings.isShow">
        <x-header :left-options="{showBack: settings.showBack, preventGoBack: true}"
                  :right-options="{showMore: settings.showMore}"
                  @on-click-more="onMoreClick"
                  @on-click-back="onBackClick">
            {{settings.title}}
        </x-header>
    </div>
</template>
<script>
    import {XHeader} from 'vux'
    import * as constants from 'src/AppConstants'
    import * as types from 'store/mutation-types'
    import utils from 'commons/utils'

    export default {
        components: {
            XHeader,
        },
        props: {
            settings: {
                type: Object,
                require: true
            }
        },
        data(){
        	return {}
        },
        methods: {
            onBackClick() {
                this.$store.commit(types.UPDATE_BACK_STATUS, true)
                utils.callFun(this.settings.backEvent)
                history.go(-1)
            },
            onMoreClick() {
            	utils.callFun(this.settings.moreEvent)
            }
        },
        created() {
        }
    }
</script>
<style lang="less">
</style>

